from lib.ZImage import ZImage
from lib.ZLoadJson import ZLoadJson
from lib.ZScene import ZScene
from lib.res.fun import _play_bgm
from lib.res.glo import SRC
from resource.script.Player.lib.Player import Player
from resource.ui.layouts import MainMenu , PanelData
from resource.ui.maps import DefaultMap

players = [ ]
players.append ( Player ( ZLoadJson ( SRC [ 'data' ] [ 'char' ] [ 'player' ] [ 0 ] ).get ( ) ) )


class MainScene ( ZScene ) :
	def __init__ ( self ) :
		super ( MainScene , self ).__init__ ( )
		self._add ( ZImage ( self , SRC [ 'image' ] [ 'test' ] ) ,
		            MainMenu ( self ) )
		_play_bgm ( SRC [ 'sound' ] [ 'bgm' ] [ 'pal_bg_1' ] )

	def draw ( self ) :
		super ( MainScene , self ).draw ( )


class GameScene ( ZScene ) :
	def __init__ ( self ) :
		super ( GameScene , self ).__init__ ( )
		self._add ( DefaultMap ( self ) )
		self._add ( PanelData ( self , players ) )
		_play_bgm ( SRC [ 'sound' ] [ 'bgm' ] [ 'fight_bg_1' ] )

	def draw ( self ) :
		super ( GameScene , self ).draw ( )
